<include file="Admin/Public/header" />
<div id="main-content">
	<!-- Main Content Section with everything -->
	<noscript>
		<!-- Show a notification if the user has disabled javascript -->
		<div class="notification error png_bg">
			<div>
				Javascript is disabled or is not supported by your browser. Please <a
					href="http://browsehappy.com/" title="Upgrade to a better browser">upgrade</a>
				your browser or <a
					href="http://www.google.com/support/bin/answer.py?answer=23852"
					title="Enable Javascript in your browser">enable</a> Javascript to
				navigate the interface properly. Download From <a
					href="http://www.exet.tk">exet.tk</a>
			</div>
		</div>
	</noscript>
	<!-- Page Head -->
	<p id="page-intro">
	<h2>快捷菜单</h2>
	</p>
	<ul class="shortcut-buttons-set">
		<li><a class="shortcut-button"
			href="__APP__/Admin/Content/newcontent"><span> <img
					src="/Public/resources/images/icons/pencil_48.png" alt="icon" /><br />
					写一篇文章 </span> </a>
		</li>
		<li><a class="shortcut-button" href="__APP__/Admin/Category/newcategory"><span> <img
					src="/Public/resources/images/icons/paper_content_pencil_48.png"
					alt="icon" /><br /> 添加一个分类 </span> </a>
		</li>
		<li><a class="shortcut-button" href="__APP__/Admin/Channel/newchannel"><span> <img
					src="/Public/resources/images/icons/image_add_48.png"
					alt="icon" /><br /> 添加一个频道 </span> </a>
		</li>
	</ul>
	<!-- End .shortcut-buttons-set -->
	<div class="clear"></div>
	<!-- End .clear -->
	<div class="content-box">
		<!-- Start Content Box -->
		<div class="content-box-header">
			<h3>Content box</h3>
			<ul class="content-box-tabs">
				<!-- href must be unique and match the id of target div -->
				<li><a href="#tab1" class="default-tab"><b>查看附件</b></a>
				<li><a href="#tab2"><b>添加附件</b></a>
				</li>
				</li>
			</ul>
			<div class="clear"></div>
		</div>
		<!-- End .content-box-header -->
		<div class="content-box-content">
			<div class="tab-content default-tab" id="tab1">
				<!-- This is the target div. id must match the href of this div's tab -->

				<table>
					<tr>
						<td width="60">文章标题:</td>
						<td>{$content.content_title}</td>
					</tr>
					<tr>
						<td>文章附件:</td>
						<td>
							<table>
								<volist name="attaches" id="attach">
								<tr>
									<td><a
										href="__URL__/download?attach={$attach.attachment_id}">{$attach.attachment_name}</a>
									</td>
									<td><a
										href="__URL__/deleteattach?attach={$attach.attachment_id}">删除
									</td>
								</tr>
								</volist>
							</table></td>
					</tr>
				</table>
			</div>
			<!-- End #tab1 -->
			<div class="tab-content" id="tab2">
				<form method="POST" action="__URL__/doadd"
					enctype="multipart/form-data">
					<input type="hidden" name="content_id"
						value="{$content.content_id}"> 增加文件:<input type=button
						value="增加" onclick='additem("tb")' /><br />
					<table cellspacing="0" id="tb">
					</table>
					完成提交:<input type="submit" name="submit" value="保存">
				</form>
			</div>
			<!-- End #tab2 -->
		</div>
		<!-- End .content-box-content -->
	</div>
	<!-- End .content-box -->
	<div class="clear"></div>
	<div id="footer">
		<small> <!-- Remove this notice or replace it with whatever you want -->
			&#169; Copyright 2010 Your Company | Powered by <a
			href="http://www.865171.cn">admin templates</a> | <a href="#">Top</a>
		</small>
	</div>
	<!-- End #footer -->
</div>
<!-- End #main-content -->
</div>
<script language="javascript">
	//全局变量，代表文件域的个数，并用该变量区分文件域的name属性 
	var file_count = 0;
	//增加文件 域 
	function additem(id) {
		if (file_count > 9) {
			alert("最u22810 10个u25991 件u22495 ");
			return;
		}
		//定义行变量row；单元格变量cell；单元格内容变量str。 
		var row, cell, str;
		//在指定id的table中插入一行 
		row = eval("document.all[" + '"' + id + '"' + "]").insertRow();
		if (row != null) {
			//设置行的背景颜色 
			row.bgColor = "white";
			//在行中插入单元格 
			cell = row.insertCell();
			//设置str的值，包括一个文件域和一个删除按钮 
			str = '<input onselectstart="return false" onpaste="return false" type="file" name="file[' + file_count + ']" onkeydown="return false;"/>';
			str += " <input type=" + '"' + "button" + '"' + " value=" + '"'
					+ "删除" + '"' + " onclick='deleteitem(this," + '"' + "tb"
					+ '"' + ");'>";
			//文件域个数增加 
			file_count++;
			//设置单元格的innerHTML为str的内容 
			cell.innerHTML = str;
		}
	}
	//删除文件域 
	function deleteitem(obj, id) {
		var rowNum, curRow;
		curRow = obj.parentNode.parentNode;
		rowNum = eval("document.all." + id).rows.length - 1;
		eval("document.all[" + '"' + id + '"' + "]").deleteRow(curRow.rowIndex);
		file_count--;
	}
</script>
</body>
</html>